define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
    var Controller = {
        index: function () {
            // 初始化表格参数配置

        },
        sentiment:function () {
            //舆情
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'crm/Buserinfo/sentiment',
                    add_url: '',
                    edit_url: '',
                    del_url: '',
                    multi_url: '',
                    table: ''

                },
                queryParams: function (params) {
                    // 自定义搜索条件
                    var filter = params.filter ? JSON.parse(params.filter) : {};
                    var op = params.op ? JSON.parse(params.op) : {};
                    //filter.后跟的是在ajax里使用的名称
                    params.filter = JSON.stringify(filter);
                    params.op = JSON.stringify(op);
                    params['ids'] = ids;
                    return params;
                }
            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                commonSearch: false,
                columns: [
                    [
                        {checkbox: true},
                        {field: 'title', title: __('Title'),operate:'like'},
                        {field: 'url', title: __('Url'),operate:'like',formatter:Table.api.formatter.url},
                        {field: 'fromweb', title: __('Fromweb'),operateL:'like'},
                        {field: 'side', title: __('Side'),searchList: {"1":__('Side 1'),"2":__('Side 2'),"3":__('Side 3'),"4":__('Side 4'),"5":__('Side 5')}, formatter: Table.api.formatter.normal},
                    ]
                ]
            });

            // 为表格绑定事件
            Table.api.bindevent(table);
        }
    };
    return Controller;
});